import { createRouter, createWebHashHistory } from "vue-router";
const routes = [
    {
        path: '/login',
        name: 'login',
        component: () => import('../views/login.vue')
    },
    {
        path: '/register',
        name: 'register',
        component: () => import('../views/register.vue')
    },
    {
        path:"/",
        name:'root',
        component: () => import('../views/root.vue'),
        children:[
            {
                path:"index",
                name:'index',
                component:() => import('../views/IndexSubview/index')
            },
            {
                path:"publish",
                name:"publish",
                component:() => import('../views/IndexSubview/publish')
            },
            {
                path:"user",
                name:"user",
                component:() => import('../views/IndexSubview/user')
            },
            {
                path:"about",
                name:"about",
                component:() => import('../views/IndexSubview/about')
            }
        ]
    },
    {
        path:"/category/:category",
        name:"category",
        component:() => import('../views/category')
    }
];

export default createRouter({
    history: createWebHashHistory(),
    routes,
});
